package com.game.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.game.entity.req.PlayerSaveReqBody;
import com.game.service.PlayerServiceImp;
import com.game.utils.IpUtils;

@RestController
public class PlayerController {

	@Autowired
	private PlayerServiceImp playerServiceImp;

	@PostMapping("/savePlayer")
	public String savePlayer(@RequestBody PlayerSaveReqBody playerSaveReqBody, HttpServletRequest request) {
		return playerServiceImp.savePlayer(playerSaveReqBody, IpUtils.getClientIp(request));
	}
}
